package com.dream.commons.result;

import java.io.Serializable;

/**
 * 分页工具
 */
public class PageUtil implements Serializable {
  
  private static final long serialVersionUID = 1L;
  private int page=1;//当前页
  private int pageCount;//总页数
  private int limit=10;//每页大小 默认5
  private int itemCount;//总条数
 
  public PageUtil() {
  }
  
  public PageUtil(int page, int limit) {
	this.page = page;
	this.limit = limit;
  }

public PageUtil(int page, int itemCount, int limit) {
	this.page = page;
	this.itemCount = itemCount;
	this.limit = limit;
	this.pageCount =(int)Math.ceil(itemCount*1.0/limit);	
}

public int getPage() {
	return page;
}

public void setPage(int page) {
	this.page = page;
}

public int getPageCount() {
	return pageCount;
}

public void setPageCount(int pageCount) {
	this.pageCount = pageCount;
}

public int getItemCount() {
	return itemCount;
}

public void setItemCount(int itemCount) {
	this.itemCount = itemCount;
}

public int getLimit() {
	return limit;
}

public void setLimit(int limit) {
	this.limit = limit;
}
}
